package com.hfh.main.weight.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 课程列表
 * </p>
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("col_score_weight")
@Schema(name = "ScoreWeightEntity", description = "$!{table.comment}")
public class ScoreWeightEntity extends Model<ScoreWeightEntity> {

    @Schema(description = "主键")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @Schema(description = "答辩次数")
    @TableField("answer_count")
    private String answerCount;

    @Schema(description = "日常权重")
    @TableField("daily_weight")
    private Double dailyWeight;

    @Schema(description = "单次权重")
    @TableField("one_weight")
    private Double oneWeight;

    @Schema(description = "中期权重")
    @TableField("two_weight")
    private Double twoWeight;

    @Schema(description = "终期权重")
    @TableField("final_weight")
    private Double finalWeight;

    @Schema(description = "创建者")
    @TableField("create_by")
    private String createBy;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建时间")
    @TableField("create_time")
    private Date createTime;

    @Schema(description = "更新者")
    @TableField("update_by")
    private String updateBy;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "更新时间")
    @TableField("update_time")
    private Date updateTime;

    @Schema(description = "伪删除")
    @TableField("undock")
    private Integer undock;

    @Schema(description = "状态")
    @TableField("state")
    private Integer state;

    @Schema(description = "备注")
    @TableField("remark")
    private String remark;

    //字段补充
    @Schema(description = "起始时间")
    @TableField(exist = false)
    private Date startTime;

    @Schema(description = "结束时间")
    @TableField(exist = false)
    private Date endTime;


    @Override
    public Serializable pkVal() {
        return this.id;
    }
}
